package com.spark.lola.logistics.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spark.lola.logistics.entity.ExpensesInfo;
import com.spark.lola.logistics.vo.ExpensesAnalyzeVo;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.QueryParam;
import com.spark.lola.support.mybatis.service.BaseService;

import java.math.BigDecimal;

/**
 * @author: Zhi-peng wang
 * @date: 2020/05/07 11:23
 * 货运支出单业务接口
 **/
public interface ExpensesInfoService extends BaseService<ExpensesInfo> {

    IPage<ExpensesInfo> findPage(QueryParam<ExpensesInfo> queryParam);

    ExpensesInfo findInfo(long id);

    /**
     * @description: 创建货运支出单
     * @param: expensesInfo 货运支出单信息
     * @param: orderId 货运单id
     * @param: shiroUser
     * @return: ExpensesInfo 货运单信息
     * @author: wzp
     * @date: 2020/5/8
     */
    ExpensesInfo addExpenses(ExpensesInfo expensesInfo, ShiroUser shiroUser) throws Exception;

    ExpensesInfo updateExpenses(ExpensesInfo expensesInfo, ShiroUser shiroUser) throws Exception;

    /**
     * @description: 删除货运单支出单
     * @param: expensesInfoId 货运支出单id
     * @return: boolean 是否成功
     * @author: wzp
     * @date: 2020/5/6
     */
    void deleteOrder(long expensesInfoId, ShiroUser shiroUser) throws Exception;

//    /**
//     * @description: 审核
//     * @param: expensesInfoId 货运支出单id
//     * @param: shiroUser
//     * @return: void
//     * @author: wzp
//     * @date: 2020/5/8
//     */
//    void audit(long expensesInfoId, ShiroUser shiroUser) throws Exception;

//    /**
//     * @description: 物流主管审核
//     * @param: expensesInfoId 货运支出单id
//     * @param: shiroUser
//     * @return: void
//     * @author: wzp
//     * @date: 2020/5/28
//     */
//    void logisticsAudit(long expensesInfoId, String msg, ShiroUser shiroUser) throws Exception;
//
    /**
     * @description: 财务审核
     * @param: expensesInfoId 货运支出单id
     * @param: shiroUser
     * @return: void
     * @author: wzp
     * @date: 2020/5/8
     */
    void financeAudit(long expensesInfoId, BigDecimal refundableFee, String msg, ShiroUser shiroUser) throws Exception;

//    /**
//     * @description: 取消
//     * @param: expensesInfoId 货运支出单id
//     * @param: shiroUser
//     * @return: void
//     * @author: wzp
//     * @date: 2020/5/8
//     */
//    void cancel(long expensesInfoId, String msg, ShiroUser shiroUser) throws Exception;

    /**
     * @description: 完成
     * @param: expensesInfoId 货运支出单id
     * @param: refundableFee 应退费用
     * @param: shiroUser
     * @return: void
     * @author: wzp
     * @date: 2020/5/8
     */
    void complete(long expensesInfoId, String evidence, ShiroUser shiroUser) throws Exception;

    /**
     * @description: 驳回
     * @param: expensesInfoId 货运支出单id
     * @param: msg 描述
     * @param: shiroUser
     * @return: void
     * @author: wzp
     * @date: 2020/5/8
     */
    void rejected(long expensesInfoId, String msg, ShiroUser shiroUser) throws Exception;

    IPage<ExpensesAnalyzeVo> findPageAnalyze(QueryParam<ExpensesAnalyzeVo> queryParam);

}
